
/**
 * echarat的配置
 */
!function(win){
    "use strict";
    var EchartOption = function(){

    }
    EchartOption.prototype={
        constructor:EchartOption,
        
		
		
		/**
		 * 仪表盘
		 */
		gauge:function() {
		    var option =  {/* 仪表盘4 */
		        series: [
		            {
		                type: 'gauge',
		                radius: '100%',//半径
		                axisLine: {// 最外面的圈
		                    lineStyle: {
		                        width: 10,//圈的宽度
		                        color: [//不同长度，圈的颜色
		                            [0.3, '#67e0e3'],
		                            [0.7, '#37a2da'],
		                            [1, '#fd666d']
		                        ]
		                    }
		                },
		                pointer: {
		                    itemStyle: {
		                        color: 'auto'
		                    }
		                },
		                axisTick: {//中间的刻度 细
		                    distance: -10,
		                    length: 5,
		                    lineStyle: {
		                        color: '#fff',
		                        width: 2
		                    }
		                },
		                splitLine: { //中间的刻度 粗
		                    distance: -10,
		                    length: 10,
		                    lineStyle: {
		                        color: '#fff',
		                        width: 2
		                    }
		                },
		                axisLabel: {//刻度数字
		                    color: 'auto',
		                    distance: 15,
		                    fontSize: 14,
		                    formatter: function (val) {
		                        //解决刻度的值为浮点数问题
		                        return Math.ceil(val);
		                    }
		                },
		                detail: {//下方显示的大数字
		                    valueAnimation: true,
		                    //formatter: '{value} km/h',
		                    color: 'auto'
		                },
		                data: [
		                    {
		                        value: 0
		                    }
		                ]
		            }
		        ]
		
		    };
		    return option;
	    },
		
		/**
		 * 仪表盘2
		 */
		gauge2:function() {
		    var option =  {/* 仪表盘2 */
		
		            color: '#f00',
		            tooltip: { show: false },
		            grid: {
		                left: '0%',
		                right: '0%',
		                bottom: '0%',
		                top: '0%',
		                containLabel: true,
		                borderWidth: '0'
		            },
		            title: {
		                text: "",
		                bottom: '20%',
		                left: '40%',
		                textStyle: {
		                    fontSize: '1vw',
		                    color: '#fff'
		                }
		            },
		            series: [
		                {
		                    name: '',
		                    type: 'gauge',
		                    radius: '90%',
		                    splitNumber: 10, // 分割段数，默认为5
		                    z: 8,
		                    min: 0,
		                    max: 100,
		
		                    axisLine: { // 坐标轴线
		                        lineStyle: { // 属性lineStyle控制线条样式
		                            color: [[1, '#ff0000']],
		                            width: 0
		                        }
		                    },
		                    axisTick: { // 坐标轴小标记
		                        splitNumber: 5, // 每份split细分多少段
		                        length:10, // 属性length控制线长
		                        lineStyle: { // 属性lineStyle控制线条样式
		                            color: '#a38080',
		                            width: 2,
		                        }
		                    },
		                    axisLabel: { // 坐标轴文本标签，详见axis.axisLabel
		                        distance:10,
		                        textStyle: { // 其余属性默认使用全局文本样式，详见TEXTSTYLE
		                            color: '#ff0000',
		                            fontSize: "14",
		                        }
		                    },
		                    splitLine: { // 分隔线
		                        show: true, // 默认显示，属性show控制显示与否
		                        length: 20, // 属性length控制线长
		                        lineStyle: { // 属性lineStyle（详见lineStyle）控制线条样式
		                            color: 'auto',
		                            width: 5,
		                        }
		                    },
		                    pointer: {
		                        show: true,
		                        width: 5,
		                        length: '70%',
		                        color: '#fff'
		
		                    },
		                    detail: {
		                        show: false,
		                    },
		                    title: {
		                        show: false,
		                    },
		                    data: [{
		                        value:0,
								name:''
		                    }]
		                },
		                {
		                    type: "gauge",
		                    radius: "99%",
		                    startAngle: "225",
		                    endAngle: "-45",
		                    splitNumber: "120",
		                    pointer: {
		                        show: false,
		                    },
		                    detail: {
		                        show: false,
		                    },
		
		                    axisLine: {
		                        show: true,
		                        lineStyle: {
		                            color: [
		                                [1, "yellow"]
		                            ],
		                            width: 2,
		                            opacity: 1,
		                        },
		                    },
		                    axisTick: {
		                        show: false,
		                    },
		                    splitLine: {
		                        show: false,
		
		                    },
		                    axisLabel: {
		                        show: false,
		                    },
		                },
		                {
		                    type: "gauge",
		                    radius: "82%",
		                    startAngle: "225",
		                    endAngle: "-45",
		                    pointer: {
		                        show: true,
		                    },
		
		                    // data: [{
		                    //     name: "数值",
		                    //     value: (99 / 200) * 100,
		                    // }],
		                    title: {
		                        show: false,
		                    },
		                    axisLine: {
		                        show: true,
		                        lineStyle: {
		                            color: '#fff',
		                            width: 10,
		                            shadowOffsetX: 0,
		                            shadowOffsetY: 0,
		                            opacity: 1,
		                        },
		                    },
		                    axisTick: {
		                        show: false,
		                    },
		                    splitLine: {
		                        show: false,
		                        length: 25,
		                        lineStyle: {
		                            color: "green",
		                            width:10,
		                            type: "solid",
		                        },
		                    },
		                    axisLabel: {
		                        show: false,
		                        formatter: function (v) {
		                            return v.toFixed(0);
		                        },
		                    },
		                    animationDuration: 4000,
		                },
		                {
		
		                    type: "gauge",
		                    z: 2,
		                    radius: "92%",
		                    startAngle: "225",
		                    endAngle: "-45",
		                    //center: ["50%", "75%"], //整体的位置设置
		                    axisLine: {
		                        // 坐标轴线
		                        lineStyle: {
		                            // 属性lineStyle控制线条样式
		                            color: [
		                                [1, "#c47d7d"]
		                            ],
		                            fontSize: 40,
		                            width: 1,
		                            opacity: 1, //刻度背景宽度
		                        },
		                    },
		                    splitLine: {
		                        show: false,
		                    },
		                    axisLabel: {
		                        show: false,
		                        formatter: function (v) {
		                            return v.toFixed(0);
		                        },
		                    },
		                    pointer: {
		                        show: false,
		                    },
		                    axisTick: {
		                        show: false,
		                    },
		                    detail: {
		                        show: false,
		                    },
		                },
		
		
		
		
		            ]
		        };
		    return option;
		
		},
       
		/* 仪表盘3 */
		gauge3:function() {
          var option =  {

              tooltip: {
                  formatter: '{a} <br/>{b} : {c}%'
              },
              series: [
                  {
                      min: 50,
                      max: 100,
                      type: 'gauge',
                      radius: '100%',
                      axisLine:{//最外面一圈
                          lineStyle:{
                              width:10
                          }
                      },
                      splitLine: {//中间有刻度的分割线
                          show: true,
                          length: 10,
                          distance: 5,
                          lineStyle: {
                              color: "#63677A",
                              width: 3,
                              type: 'solid',
                              dashOffset: 0,
                              cap: 'butt',
                              join: 'bevel',
                              miterLimit: 10
                          }
                      },
                      axisLabel: {
                          //distance: 13,
                          //color: '#999',
                          fontSize: 14,
                          formatter: function (val) {
                              //解决刻度的值为浮点数问题
                              return Math.ceil(val);
                          }
                      },
                      pointer: {//指针
                          show: true,
                          showAbove: true,
                          offsetCenter: [0, 0],
                          length: '55%',
                          width: 6,
                          keepAspect: false,
                      },

                      title: {
                          show: false,
                      },
                      progress: {
                          show: true
                      },
                      detail: {
                          valueAnimation: true,
                          formatter: '{value}'
                      },
                      data: [
                          {
                              value: 0
                          }
                      ]
                  }
              ]
            };
            return option;

        },
        /**
         * 仪表盘4
         */
        gauge4:function() {
            var option =  {
                series: [
                        {
                            type: 'gauge',
                            radius: '100%',
                            progress: {
                                show: true,
                            },
                            axisLine: {
                                lineStyle: {
                                    width: 10
                                }
                            },
                            axisTick: {
                                show: false
                            },
                            splitLine: {
                                distance: 5,
                                length: 5,
                                lineStyle: {
                                    width: 2,
                                    color: '#999'
                                }
                            },
                            axisLabel: {
                                distance: 13,
                                color: "#63677A",
                                fontSize: 14,
                                formatter: function (val) {
                                    //解决刻度的值为浮点数问题
                                    return Math.ceil(val);
                                }
                            },
                            anchor: {
                                show: true,
                                showAbove: true,
                                size: 10,
                                itemStyle: {
                                    borderWidth: 5
                                }
                            },
                            title: {
                                show: false
                            },
                            detail: {
                                valueAnimation: true,
                               // fontSize: 80,
                                offsetCenter: [0, '70%']
                            },
                            data: [
                                {
                                    value: 0
                                }
                            ]
                        }
                    ]

                };
            return option;

        },
       
        
        /**
         * 仪表盘5
         */
        gauge5:function() {
            var option =  {/* 仪表盘5 这个是叠加了两个表盘 */
                series: [
                    {
                        type: 'gauge',
                        radius: '60%',//半径
                       // center: ['50%', '60%'],
                        startAngle: 200,
                        endAngle: -20,
                        min: 0,
                        max: 60,
                        splitNumber: 12,
                        itemStyle: {
                            color: '#FFAB91'
                        },
                        progress: {
                            show: true,
                            width: 15
                        },
                        pointer: {
                            show: false
                        },
                        axisLine: {
                            lineStyle: {
                                width: 15
                            }
                        },
                        axisTick: {
                            distance: -25,
                            splitNumber: 5,
                            lineStyle: {
                                width: 2,
                                color: '#999'
                            }
                        },
                        splitLine: {
                            distance: -30,
                            length: 14,
                            lineStyle: {
                                width: 2,
                                color: '#999'
                            }
                        },
                        axisLabel: {
                            distance: -15,
                            color: '#555',
                            fontSize: 14,
                            formatter: function (val) {
                                //解决刻度的值为浮点数问题
                                return Math.ceil(val);
                            }
                        },
                        anchor: {
                            show: false
                        },
                        title: {
                            show: false
                        },
                        detail: {
                            valueAnimation: true,
                            width: '60%',
                            lineHeight: 40,
                            borderRadius: 8,
                            offsetCenter: [0, '-1%'],
                            //fontSize: 60,
                            fontWeight: 'bolder',
                            //formatter: '{value} °C',
                            color: 'auto'
                        },
                        data: [
                            {
                                value: 0
                            }
                        ]
                    },
                    {
                        type: 'gauge',
                        radius: '60%',//半径
                       // center: ['50%', '60%'],
                        startAngle: 200,
                        endAngle: -20,
                        min: 0,
                        max: 60,
                        itemStyle: {
                            color: '#FD7347'
                        },
                        progress: {
                            show: true,
                            width: 5
                        },
                        pointer: {
                            show: false
                        },
                        axisLine: {
                            show: false
                        },
                        axisTick: {
                            show: false
                        },
                        splitLine: {
                            show: false
                        },
                        axisLabel: {
                            show: false
                        },
                        detail: {
                            show: false
                        },
                        data: [
                            {
                                value: 0
                            }
                        ]
                    }
                ]

            };
            return option;

        },
		//气压表盘
		gauge6:function() {
			let option = {
			  series: [
			    {
			      type: 'gauge',
			      min: 0,
			      max: 100,
			      splitNumber: 10,
			      radius: '76%',
			      axisLine: {
			        lineStyle: {
			          color: [[1, '#f00']],
			          width: 3
			        }
			      },
			      splitLine: {
			        distance: -12,
			        length: 12,
			        lineStyle: {
			          color: '#f00'
			        }
			      },
			      axisTick: {
			        distance: -12,
			        length: 10,
			        lineStyle: {
			          color: '#f00'
			        }
			      },
			      axisLabel: {
			        distance: -24,
			        color: '#f00',
			        fontSize: 12
			      },
			      anchor: {
			        show: true,
			        size:16,
			        itemStyle: {
			          borderColor: '#000',
			          borderWidth: 2
			        }
			      },
			      pointer: {
			        offsetCenter: [0, '10%'],
			        icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z',
			        length: '115%',
			        itemStyle: {
			          color: '#000'
			        }
			      },
			      detail: {
			        valueAnimation: true,
			        precision: 1
			      },
			      title: {
			        offsetCenter: [0, '-40%']
			      },
			      data: [
			        {
			          value:0,
			          name: 'PLP'
			        }
			      ]
			    },
			    {
			      type: 'gauge',
			      min: 0,
			      max: 60,
			      splitNumber: 4,
				  radius: '70%',
			      axisLine: {
			        lineStyle: {
			          color: [[1, '#000']],
			          width: 3
			        }
			      },
			      splitLine: {
			        distance: -3,
			        length: 12,
			        lineStyle: {
			          color: '#000'
			        }
			      },
			      axisTick: {
			        distance: 0,
			        length: 10,
			        lineStyle: {
			          color: '#000'
			        }
			      },
			      axisLabel: {
			        distance:8,
			        fontSize: 12,
			        color: '#000'
			      },
			      pointer: {
			        show: false
			      },
			      title: {
			        show: false
			      },
				  anchor: {
			        show: true,
			        size: 10,
			        itemStyle: {
			          color: '#000'
			        }
			      }
				  
			    }
			  ]
			};
			return option;
		},
		
		
		//速度表盘
		gauge7:function(){
			let option = {
			
			series: [
			    {
			      type: 'gauge',
			      startAngle: 180,
			      endAngle: 0,
			      min: 0,
			      max: 240,
				  splitNumber: 12,
			      itemStyle: {
			        color: '#58D9F9',
			        shadowColor: 'rgba(0,138,255,0.45)',
			        shadowBlur: 10,
			        shadowOffsetX: 2,
			        shadowOffsetY: 2
			      },
			      progress: {
			        show: true,
			        roundCap: true,
			        width:10
			      },
			      pointer: {
			        icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z',
			        length: '75%',
			        width: 10,
			        offsetCenter: [0, '10%']
			      },
			      axisLine: {
					roundCap: true,
			        lineStyle: {
			          width: 10
			        }
			      },
			      axisTick: {
			        splitNumber: 2,
			        lineStyle: {
			          width: 2,
			          color: '#999'
			        }
			      },
			      splitLine: {
			        length:8,
					distance:5,
			        lineStyle: {
			          width: 3,
			          color: '#999'
			        }
			      },
			      axisLabel: {
			        distance:15,
			        color: '#555',
			        fontSize:14
			      },
			      title: {
			        show: false
			      },
			      detail: {
					//show:false,  
			        backgroundColor: 'transparent',
			        borderColor: '#999',
			        borderWidth: 1,
			        width: '56%',
			        lineHeight:26,
			        height:26,
			        borderRadius: 8,
			        offsetCenter: [0, '28%'],
			        valueAnimation: true,
			        formatter: function (value) {
			          return '{value|' + value.toFixed(0) + '}{unit|km/h}';
			        },
			        rich: {
			          value: {
			            fontSize:24,
			            fontWeight: 'bolder',
			            color: '#777'
			          },
			          unit: {
			            fontSize:14,
			            color: '#999',
			            padding: [0, 0, -20, 5]
			          }
			        }
			      },
			      data: [
			        {
			          value:120,
					  name:''
			         
			        }
			      ]
			    }
			  ]
			};
			return option;
		},
		
		/**
		 * 仪表盘7
		 */
		// gauge7:function() {
		//     var option =  {/* 仪表盘3 */
		//         series: [
		//             {
		//                 type: 'gauge',
		//                 radius: '100%',
		//                 startAngle: 180,
		//                 endAngle: 0,
		//                 min: 0,
		//                 max: 240,
		//                 splitNumber: 12,
		//                 itemStyle: {
		//                     color: '#58D9F9',
		//                     shadowColor: 'rgba(0,138,255,0.45)',
		//                     shadowBlur: 10,
		//                     shadowOffsetX: 2,
		//                     shadowOffsetY: 2
		//                 },
		//                 progress: {
		//                     show: true,
		//                     roundCap: true,
		//                     width: 10
		//                 },
		//                 pointer: {
		//                     icon: 'path://M2090.36389,615.30999 L2090.36389,615.30999 C2091.48372,615.30999 2092.40383,616.194028 2092.44859,617.312956 L2096.90698,728.755929 C2097.05155,732.369577 2094.2393,735.416212 2090.62566,735.56078 C2090.53845,735.564269 2090.45117,735.566014 2090.36389,735.566014 L2090.36389,735.566014 C2086.74736,735.566014 2083.81557,732.63423 2083.81557,729.017692 C2083.81557,728.930412 2083.81732,728.84314 2083.82081,728.755929 L2088.2792,617.312956 C2088.32396,616.194028 2089.24407,615.30999 2090.36389,615.30999 Z',
		//                     length: '60%',
		//                     width: 6,
		//                     offsetCenter: [0, '5%']
		//                 },
		//                 axisLine: {
		//                     roundCap: true,
		//                     lineStyle: {
		//                         width: 10
		//                     }
		//                 },
		//                 axisTick: {
		//                     splitNumber: 2,
		//                     lineStyle: {
		//                         width: 2,
		//                         color: '#999'
		//                     }
		//                 },
		//                 splitLine: {
		//                     distance: 5,
		//                     length: 10,
		//                     lineStyle: {
		//                         width: 2,
		//                         color: '#999'
		//                     }
		//                 },
		//                 axisLabel: {
		//                     distance: 15,
		//                     color: '#999',
		//                     //fontSize: 20,
		//                     formatter: function (val) {
		//                         //解决刻度的值为浮点数问题
		//                         return Math.ceil(val);
		//                     }
		//                 },
		//                 title: {
		//                     show: false
		//                 },
		//                 detail: {
		//                     show:true,
		//                     valueAnimation: true,
		//                     // fontSize: 80,
		//                     offsetCenter: [0, '-25%']
		//                 },
		//                 data: [
		//                     {
		//                         value: 0
		//                     }
		//                 ]
		//             }
		//         ]
		
		//     };
		//     return option;
		
		// },
        /**
         * 温度计
         * value 当前温度
         * wd_max 0上最大温度
         * wd_min 0下最大温度
         */
        windu:function(value,wd_max,wd_min) {

            /*****设置温度计相关设置start*****/
            var TP_name="";
            var TP_value =value;//值
            var min = 0;//最小刻度
            var max = wd_max+wd_min;//最大刻度
            var offset = wd_min;//负数设置
            var step = 10;//步长
            var range = [0,30,50]//范围[高,中,低]
            var unit = '°C';//单位
            /**************/
            var scale = step/20;//比例
            var kd = [];
            var Gradient = [];
            var leftColor = '';
            var showValue = '';
            var len = max+(scale*15);//刻度+15
            var TP_txt = '';
// 刻度使用柱状图模拟，短设置1，长的设置3；构造一个数据
            for (var i = 0; i <= len; i++) {
                if (i < (min+(scale*10)) || i > (max+(scale*10))) {
                    kd.push('')
                } else {
                    if ((i - (scale*10)) % step === 0) {
                        kd.push('-10');
                    } else if ((i - (scale*10)) % (step/5) === 0) {
                        kd.push('-5');
                    } else {
                        kd.push('');
                    }
                }

            }
//中间线的渐变色和文本内容
            if (TP_value > range[2]) {
                Gradient.push({
                    offset: 0,
                    color: '#93FE94'
                }, {
                    offset: 0.5,
                    color: '#E4D225'
                }, {
                    offset: 1,
                    color: '#E01F28'
                })
            } else if (TP_value > range[1]) {
                Gradient.push({
                    offset: 0,
                    color: '#93FE94'
                }, {
                    offset: 1,
                    color: '#E4D225'
                })
            } else {
                Gradient.push({
                    offset: 1,
                    color: '#93FE94'
                })
            }
            if (TP_value > (max-offset+(scale*2))) {
                showValue = max-offset+(scale*2);
            } else if (TP_value < min-offset) {
                showValue = min-offset;
            } else {
                showValue = TP_value
            }

            offset = offset+(scale*10);//负数设置+10
            leftColor = Gradient[Gradient.length - 1].color;
// 因为柱状初始化为0，温度存在负值，所以加上负值60和空出距离10


            /*****设置温度计相关设置end*****/

            var option =  {//温度计

                grid:{
                    top:'5%',
                    bottom:'6%',
                    left:'0',


                },
                yAxis: [{
                    show: false,
                    data: [],
                    min: 0,
                    max: len,
                    axisLine: {
                        show: false
                    }
                }, {
                    show: false,
                    min: 0,
                    max: 50,
                }],
                xAxis: [{
                    show: true,
                    min: -100,
                    max: 70,
                    axisTick: 'none',
                    axisLine: 'none',
                    offset: 40,
                    axisLabel: {
                        textStyle: {
                            color: '#ffffff',
                            fontSize: '24',
                        },
                    },
                    data: [TP_name],
                }, {
                    show: true,
                    min: -100,
                    max: 70,
                    axisTick: 'none',
                    axisLine: 'none',
                    offset: 0,
                    axisLabel: {
                        padding: [0, 4, -8, 6],
                        textStyle: {
                            color: '#66b1fd',
                            fontSize: '10',
                        },
                    },
                    data: [TP_value+unit],
                    z: 9,
                }, {
                    show: false,
                    min: -100,
                    max: 70,
                    data: []
                }, {
                    show: false,
                    min: -70,
                    max: 80,

                }],
                series: [{
                    name: '条',
                    type: 'bar',
                    // 对应上面XAxis的第一个对)象配置
                    xAxisIndex: 0,
                    data: [{
                        value: (showValue + offset),
                    }],
                    barWidth: 5,
                    itemStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(0, 1, 0, 0, Gradient)
                        }
                    },
                    z: 2
                }, {
                    name: '白框',
                    type: 'bar',
                    xAxisIndex: 1,
                    barGap: '-100%',
                    data: [len-scale],
                    barWidth: 10,
                    itemStyle: {
                        normal: {
                            color: '#8998ff',
                            barBorderRadius: 50,
                        }
                    },
                    z: 1
                }, {
                    name: '外框',
                    type: 'bar',
                    xAxisIndex: 2,
                    barGap: '-100%',
                    data: [len],
                    barWidth: 15,
                    itemStyle: {
                        normal: {
                            color: '#4577BA',
                            barBorderRadius: 50,
                        }
                    },
                    z: 0
                }, {
                    name: '圆',
                    type: 'scatter',
                    hoverAnimation: false,
                    data: [0],
                    xAxisIndex: 0,
                    symbolSize: 15,
                    itemStyle: {
                        normal: {
                            color: '#93FE94',
                            opacity: 1,
                        }
                    },
                    z: 2
                }, {
                    name: '白圆',
                    type: 'scatter',
                    hoverAnimation: false,
                    data: [0],
                    xAxisIndex: 1,
                    symbolSize: 20,
                    itemStyle: {
                        normal: {
                            color: '#0C2E6D',
                            opacity: 1,
                        }
                    },
                    z: 1
                }, {
                    name: '外圆',
                    type: 'scatter',
                    hoverAnimation: false,
                    data: [0],
                    xAxisIndex: 2,
                    symbolSize: 25,
                    itemStyle: {
                        normal: {
                            color: '#4577BA',
                            opacity: 1,
                        }
                    },
                    z: 0
                }, {
                    name: '刻度',
                    type: 'bar',
                    yAxisIndex: 0,
                    xAxisIndex: 3,
                    label: {
                        normal: {
                            show: true,
                            position: 'left',
                            distance: 5,
                            color: '#986558',
                            fontSize: 12,
                            formatter: function(params) {
                                if (params.dataIndex > (max+(scale*10)) || params.dataIndex < (min+(scale*10))) {
                                    return '';
                                } else {
                                    if ((params.dataIndex - (scale*10)) % step === 0) {
                                        return params.dataIndex - offset;
                                    } else {
                                        return '';
                                    }
                                }
                            }
                        }
                    },
                    barGap: '-100%',
                    data: kd,
                    barWidth: 1,
                    itemStyle: {
                        normal: {
                            color: '#ff0000',
                            barBorderRadius: 120,
                        }
                    },
                    z: 0
                }]
            };
            return option;

        },
        /**
         * 实时折线图
         */
        /**
         * 实时折线图
         */
        realTimeLine:function(moduleValue) {
        
            var now = new Date();
           var dataArray={
                value: [
                    now.getFullYear()+"-"+$_check(now.getMonth()+1)+"-"+$_check(now.getDate())+" "+$_check(now.getHours())+":"+$_check(now.getMinutes())+":"+$_check(now.getSeconds()),
                    moduleValue
                ]
        
            };
            var datAArray1={
                value: [
                   '2020-12-04 01:01:02',
                    10
                ]
        
            };
            var datAArray2={
                value: [
                    '2020-12-04 01:01:03',
                    25
                ]
        
            };
            var datAArray3={
                value: [
                    '2020-12-04 01:01:04',
                    50
                ]
        
            };
            var datAArray4={
                value: [
                    '2020-12-04 01:01:05',
                    45
                ]
        
            };
            var datAArray5={
                value: [
                    '2020-12-04 01:01:06',
                    80
                ]
        
            };
        
            var data = [];
            if(moduleValue===''){
                data.push(datAArray1);
                data.push(datAArray2);
                data.push(datAArray3);
                data.push(datAArray4);
                data.push(datAArray5);
            }else{
                data.push(dataArray);
            }
        
            var option =  {
        
                grid: {
                    top:10,
                    bottom:22
                },
                title: {
                    text: ''
                },
                tooltip: {
                    trigger: 'axis',
        
                    axisPointer: {
                        animation: false
                    }
                },
                xAxis: {
                    type: 'time',
					axisLine: {//X轴的线
					    show:true,
					    lineStyle: {
					        color: '#000000',  //y轴的颜色，通常和X轴颜色一样
					    }
					}, 
                    splitLine: {
                        show: false
                    }
                },
                yAxis: {
                    type: 'value',
                    boundaryGap: [0, '100%'],
					axisLine: {//Y轴的线
					    show:true,
					    lineStyle: {
					        color: '#000000',  //y轴的颜色，通常和X轴颜色一样
					    }
					}, 
                    splitLine: {
                        show:true,
						interval: 'auto',
						lineStyle: {
						    color: ['#995911'],
						}
                    }
                },
                series: [{
                    name: '值',
                    type: 'line',
                    showSymbol: true,
                    hoverAnimation: false,
                    data: data,
					smooth: true
                }]
            };
            return option;
        
        
        },
        /**
         * 实时折线图2
         */
        realTimeLine2:function() {
            var option =  {

                title: {
                    show:false,
                    text: '图表标题'
                },
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: ['电压1', '电压2', '电压3', '电压4', '电压5'],
                    textStyle: {
                        color: '#000000',         //头部种类文字颜色(图例文字颜色)-------
                        fontStyle: 'normal',
                        fontWeight: 'normal',
                        fontFamily: 'sans-serif',
                        fontSize: 14,
                    }
                },
                grid: {
                    left: '7%',
                    right: '5%',
                    bottom:85,
                    top:60
                    // containLabel: true,
                    // show: true
                },
                toolbox: {
                    show:false,
                    feature: {
                        saveAsImage: {}
                    }
                },
                xAxis: {//x轴
                   // type: 'category',//显示类目，这里类目是时间
				    name:'',  //时间
                    boundaryGap: false,
                    data: [],
                    axisLine: {//x轴的线
                        lineStyle: {
                            color: '#000000',//X零轴颜色------
                        }
                    },
					 
					 axisTick: {//x轴的线上的刻度（竖着的短线）
                        lineStyle: {
                            //color:'#ff0000' ,//不设默认取X零轴颜色
                        }
                    },axisLabel: {//x轴的线上的文字颜色-------
                        textStyle: {
                            color:'#000000',
                        },
                        fontSize:14,
                    },
                    splitLine: {// 竖向分割线颜色------
                        show:false,
                        interval: 'auto',
                        lineStyle: {
                            color: ['#995911'],
                        }
                    }

                    },
                yAxis: {
                    type: 'value',
					name:'',    //值
                    axisLine: {//y轴的线
					    show:true,
                        lineStyle: {
                            color: '#000000',  //y轴的颜色，通常和X轴颜色一样
                        }
                    }, axisTick: {//y轴的线上的刻度（竖着的短线）
                        lineStyle: {
                            color:'#333',
                        }
                    },axisLabel: {//y轴的线上的文字颜色-------
                        textStyle: {
                            color:'#ff0000',
                        },
                        fontSize:14,
                    },
					splitLine: {// 横向分割线颜色------
                        show:true,
                        interval: 'auto',
                        lineStyle: {
                            color: ['#995911'] ,
                        }
                    }

                },
                series: [
                    {
                        name: '电压1',
                        type: 'line',
                        // stack: 'Total',
                        data: [],
						smooth: true
                    },
                    {
                        name: '电压2',
                        type: 'line',
                        //stack: 'Total',
                        data: [],
						smooth: true
                    }
                ]
            };
			return option;
		},
		
		
		//示功图曲线(双数值图)
		powerOption:function(){
			var option = {
				title: {
					text: '示功图',
					left: '1%',
					top: 10
					// textStyle: { //全局文字样式不包含它
					// 	color: "white"
					// }
				},
				grid: {
					width: '90%',
					height: '360px',
					left: '6%',
					top: 80,
			
				},
				// textStyle: {
				// 	color: "white"
				// },
				tooltip: {
					trigger: 'axis'
				},
				xAxis: {name:"X"},
				yAxis: {name:"Y"},
				series: [{
					name: '',
					type: 'line',
					data: [
						
					],
					markPoint: {
						data: [{
							type: 'max',
							name: '最大值'
						}, {
							type: 'min',
							name: '最小值'
						}]
					},
					markLine: {
						data: [{
							type: 'average',
							name: '平均值'
						}]
					},
					smooth: true
				},{
					name: '',
					type: 'line',
					data: [
						
					],
					markPoint: {
						data: [{
							type: 'max',
							name: '最大值'
						}, {
							type: 'min',
							name: '最小值'
						}]
					},
					markLine: {
						data: [{
							type: 'average',
							name: '平均值'
						}]
					},
					smooth: true
				}
				]
			}
			
			return option;
		},
		
        /**
         * 实时柱状图
         */
        realTimeBarGraph:function() {
            var option =  {
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: 5,
                    top: 20,
                    containLabel: true,
                },
                xAxis: {
                    type: 'category',
					inverse:true,
                    data: ['电流1', '电流2', '电流3', '电流4', '电流5'],
					boundaryGap: true,
                    axisLine: {//x轴的线
					    show:true,
                        lineStyle: {
                            color: '#000000',//X零轴颜色------
                        }
                    },
					axisLabel: {//x轴的线上的文字颜色-------
                        textStyle: {
                            color:'#000000',
                        },
						rotate:0,
						interval:0,  //显示所有标签文字
                        fontSize:14,
                    },
					axisTick: {
						interval:0, //显示所有刻度
						length: 6,
						alignWithLabel: true //类目轴中在 boundaryGap 为 true 的时候有效，可以保证刻度线和标签对齐
					},
					animationDuration: 300,
					animationDurationUpdate: 300,
					max:10
                },
                yAxis: {
                    type: 'value',
					axisLine: {//Y轴的线
					    show:true,
					    lineStyle: {
					        color: '#000000',//X零轴颜色------
					    }
					},
                    axisLabel: {//y轴的线上的文字颜色-------
                        textStyle: {
                            color:'#ff0000',
                        },
                        fontSize:14,
                    }, splitLine: {// 横向分割线颜色------
                        show: true,
                        interval: 'auto',
                        lineStyle: {
                            color: ['#995911'] ,
                        }
                    }
                },
                series: [
                    {
                        data: [120, 200, 150, 80, 70],
                        type: 'bar',
                        showBackground:false,
						barMaxWidth:50,
						barMinWidth:5,
						realtimeSort:false,
						// backgroundStyle: {
                        //  color: 'transparent',
						// 	shadowColor:'rgba(255,255,255,1)',
						// 	shadowBlur:10
							
                        //},
						label: {
                            color:'#000000',
                            show: true,
                            distance: 4,
							position: 'top',
                            fontSize: 14,
                            formatter:function(params){
                                return params.value+"A";
                            }
                        },
						itemStyle: {
							normal: {
								color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
									offset: 0,
									// color: "#eee"
									color: "#4FB9EA" //#90e0d0   #4FB9EA
								}, {
									offset: 1,
									color: "#2984FF"
									// color: "#cc0000"
								}], false)
							}
						},
						emphasis: {
							itemStyle: {
							  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
								{ offset: 0, color: '#2378f7' },
								{ offset: 0.7, color: '#2378f7' },
								{ offset: 1, color: '#83bff6' }
							  ])
							}
						},
						//使用下面这个时，把上面的itemStyle和emphasis注释掉
						// itemStyle: {
      //                       color:function (params) {
      //                           var i=params.dataIndex;
      //                           var colorArray = ['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc','#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc','#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc','#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc','#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc'];
      //                           return colorArray[i];
      //                       }
      //                   }
                    }
                ],
				animationDuration: 0,
				animationDurationUpdate: 1000,
				animationEasing: 'linear',
				animationEasingUpdate: 'linear'
            };
            return option;


        }, 
		//横向排名条形图
		realTimeSortBar:function(){
			// var colors = {
			//   '0': '#00008b',
			//   '1': '#f00',
			//   '2': '#ffde00',
			//   '3': '#002a8f',
			//   '4': '#003580',
			//   '5': '#ed2939',
			//   '6': '#000',
			//   '7': '#003897',
			//   '8': '#f93',
			//   '9': '#bc002d',
			//   '10': '#024fa2',
			//   '11': '#000',
			//   '12': '#00247d',
			//   '13': '#ef2b2d',
			//   '14': '#dc143c',
			//   '15': '#d52b1e',
			//   '16': '#e30a17',
			//   '17': '#00247d',
			//   '18': '#b22234',
			//   '19': '#ffff00'
			// };
			var colors = [
			  '#00008b',
			  '#f00',
			  '#ffde00',
			  '#002a8f',
			  '#003580',
			  '#ed2939',
			  '#000',
			  '#003897',
			  '#f93',
			  '#bc002d',
			  '#024fa2',
			  '#000',
			  '#00247d',
			  '#ef2b2d',
			  '#dc143c',
			  '#d52b1e',
			  '#e30a17',
			  '#00247d',
			  '#b22234',
			  '#ffff00'
			];
			var option = {
			  grid: {
			      left: '3%',
			      right: '10%',
			      bottom: 5,
			      top: 10,
			      containLabel: true,
				  // show:true,
				  // backgroundColor:"transparent"
			  },	
			  xAxis: {
			    max: 'dataMax',
				boundaryGap: true,
				axisLine: {//x轴的线
				    show:false,
				    lineStyle: {
				        color: '#000000',//X零轴颜色------
				    }
				},
				axisLabel: {//x轴的线上的文字颜色-------
				    textStyle: {
				        color:'#000000',
				    },
				    fontSize:14,
				},
				axisTick: {
					show:false,
					length: 6,
					alignWithLabel: true //类目轴中在 boundaryGap 为 true 的时候有效，可以保证刻度线和标签对齐
				},
				splitLine: {// 竖向分割线颜色------
				    show:true,
				    interval: 'auto',
				    lineStyle: {
				        color: ['#ccc'],
				    }
				}
			  },
			  yAxis: {
			    type: 'category',
				boundaryGap: true,
				axisLine: {//Y轴的线
				    show:true,
				    lineStyle: {
				        color: '#000000',//X零轴颜色------
				    },
					//轴线是否有箭头,这里只在末端显示箭头
					//symbol:['none', 'arrow'],
				},
				axisLabel: {//y轴的线上的文字颜色-------
				    textStyle: {
				        color:'#ff0000',
				    },
					interval:0,  //显示所有标签文字
				    fontSize:14
				},
				axisTick: {
					length: 6,
					alignWithLabel: true //类目轴中在 boundaryGap 为 true 的时候有效，可以保证刻度线和标签对齐
				},
			    data:[],
				//true为从下往上从小到大的，false为从下往上从大到小的
			    inverse: true,
			    animationDuration: 300,
			    animationDurationUpdate: 300,
				//如果想只显示前 n 名，将 yAxis.max 设为 n - 1，否则显示所有柱条
			    max:10
			  },
			  series: [
			    {
			      realtimeSort: true,
				  // seriesLayoutBy: 'column',
			      name: '',
			      type: 'bar',
			      data:[],
				  barMaxWidth:50,
				  barMinWidth:5,
				  itemStyle: {
					color: function (param) {
					  //console.log(param);
					  return colors[param.dataIndex] || '#5470c6';
					}
				},
			      label: {
			        show: true,
			        position: 'right',
					distance: 4,
			        valueAnimation: true
			      }
			    }
			  ],
			  legend: {
			    show:false,
				data:[]
			  },
			  animationDuration: 0,
			  animationDurationUpdate: 3000,
			  animationEasing: 'linear',
			  animationEasingUpdate: 'linear'
			};
			
			return option;
		},
		
		/**
         * 实时饼图
         */
        realTimePieGraph:function() {
            var option =  {
                tooltip: {
                    trigger: 'item'
                },
                legend: {
                    orient: 'horizontal',
                    itemWidth:10,
                    itemHeight:10,
                    textStyle: {
                        color: '#000000',//图例文字颜色
                        fontSize: 14,
                    }

                },
                series: [
                    {
                        type: 'pie',
                        radius: '95%',
                        center:['50%', '58%'],
                        data: [
                            { value: 1048, name: '电压1' },
                            { value: 735, name: '电压2' },
                            { value: 580, name: '电压3' },
                            { value: 484, name: '电压4' },
                            { value: 300, name: '电压5' }
                        ],
                        label: {
                            show: true,
                            position: 'inside' ,
                            color:'#000000',//饼内数字颜色
                            fontSize: 14,
                            //rotate:-90,
                            formatter:function(params ){
                                return params.value;
                            }
                        },
                        labelLine: {//圆圈外伸出去的线
                            show:true
                        },
                        emphasis: {
                            itemStyle: {
                                shadowBlur: 10,
                                shadowOffsetX: 0,
                                shadowColor: 'rgba(0, 0, 0, 0.5)'
                            }
                        }
                    }
                ]
            };
            return option;


        },
        /**
         * 实时环形图
         */
        realTimeCircularGraph:function() {
        var option =  {
            tooltip: {
                trigger: 'item'
            },
            legend: {
                orient: 'horizontal',
                itemWidth:10,
                itemHeight:10,
                textStyle: {
                    color: '#000000',//图例文字颜色
                    fontSize: 14,
                }

            },
            series: [
                {
                    type: 'pie',
                    radius: ['40%', '95%'],
                    center:['50%', '54%'],
                    data: [
                        { value: 1048, name: '电压1' },
                        { value: 735, name: '电压2' },
                        { value: 580, name: '电压3' },
                        { value: 484, name: '电压4' },
                        { value: 300, name: '电压5' }
                    ],
                    label: {
                        show: true,
                        position: 'inside' ,
                        color:'#000000',//饼内数字颜色
                        fontSize: 14,
                        //rotate:-90,
                        formatter:function(params ){
                            return params.value;
                        }
                    },
                    labelLine: {//圆圈外伸出去的线
                        show:false
                    },
                    emphasis: {
                        itemStyle: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };
        return option;


    },
    /**
     * 水池
     */
         pool:function() {
        var option = {
            series: [{
                type: 'liquidFill',
                data: [0],//水位百分比
				amplitude: '2%',    //波浪幅度（高度）
				waveLength: '50%',  //波长
                color: ['#0066ff'],//水的颜色
                backgroundStyle: {
                    borderWidth: 5,//边框宽度
                    borderColor: '#0000ff',//边框颜色
                    color: '#ccfffd',//背景颜色
					borderTopWidth:0
                },
                label: {
                   show:true,
				   // formatter: function(param) {
				   //                 return param.seriesName + '\n'
				   //                     + param.name + '\n'
				   //                     + 'Value:' + param.value;
				   //  },
				  
				   //下面的函数在ModuleAnimation.js中设置
				    formatter: function(param) {
						return 0;
						
						// if(param && param.value){
						// 	if(param.value<0){
						// 		return '0%';
						// 	}else{
						// 		//JS处理小数时，有时是不正确的，如0.58*100=57.99999999999999，所以要取整
						// 		return (param && param.value)?Math.round(param.value*100)+'%':'0%';      
						// 	}
						// }else{
						// 	return '0%';
						// }  
				                  
				    }
                },
                outline: {
                    show:false,    //外框不能开口，所以不显示
					borderDistance:0,
                },
                shape: 'container'
            }]
        };
        return option;


    },
	
	/**
	 * 水池
	 */
	pool2:function() {
	    var option = {
	        grid: {
	            left: '0%',
	            right: '0%',
	            bottom: 15,
	            top: 15,
	        },
	        tooltip: {
	            trigger: 'none'
	        },
	        xAxis: {
	            data: [''],
	            axisTick: {
	                show: false
	            },
	            axisLine: {
	                show: false
	            },
	            axisLabel: {
	                show: false
	            }
	        },
	        yAxis: {
	            splitLine: {
	                show: false
	            },
	            axisTick: {
	                show: false
	            },
	            axisLine: {
	                show: false
	            },
	            axisLabel: {
	                show: false
	            }
	        },
	        series: [
	            {
	            name: '外壳上面的盖子',
	            animation: false,
	            barWidth:'100%',
	            type: 'pictorialBar',
	            symbolSize: ['100%','30'],
	            symbolOffset: [0, -15],
	            z: 12,
	            itemStyle: {
	              /*  normal: {
	
	                },*/
	                opacity: 1,
	                color: '#363F5E', //桶的颜色1
	                //borderWidth:20,
	                //borderColor: '#363F5E'//桶边框颜色
	            },
	            data: [{
	                value: 100,
	                symbolPosition: 'end'
	            }]
	        },
	            {
	            name: '水的上位的圆',
	            animation: true,
	            barWidth:'100%',
	            type: 'pictorialBar',
	            symbolSize: ['100%', '30'],
	            symbolOffset: [0, -15],
	            z: 12,
	            itemStyle: {
	                normal: {
	                    color: '#00ff00'//水的颜色1
	                }
	            },
	            data: [{
	                value: 0,
	                symbolPosition: 'end'
	            }]
	        },
	            {
	            name: '水的上下位的圆',
	            barWidth:'100%',
	            animation: false,
	            type: 'pictorialBar',
	            symbolSize: ['100%', '30'],
	            symbolOffset: [0, 0],
	            z: 12,
	            itemStyle: {
	                normal: {
	                    color: '#00ff00'//水的颜色2
	                }
	            },
	            data: [{
	                value: 0,
	                symbolPosition: 'center'
	            }]
	        },
	            {
	            name:'水的背景柱子',
	           // stack:1,
	            type: 'bar',
	            animation: false,
	            itemStyle: {
	                opacity: .3,
	                color: '#363F5E', //桶的颜色2
	            },
	            silent: true,
	            barWidth: '100%',
	            // barGap: '-100%', // Make series be overlap
	            data: [100]
	        },
	            {
	            name:'水的柱子',
	            // stack:1,
	            animation: true,
	            type: 'bar',
	            itemStyle: {
	                normal: {
	                    color: '#00ff00', //水的颜色3
	                    opacity: .5
	                }
	            },
	            label: {
	                show: false,
	                position: 'inside',
	                color: "#FFFE00",
	                fontSize: 18,
	                formatter: function () {
	                    return 30 + " 米";
	                }
	            },
	            silent: true,
	            barWidth: '100%',
	            barGap: '-100%', // Make series be overlap
	            data: [0]
	        }]
	    };
	    return option;
	}


    }





    win.EchartOption = EchartOption;
}(window);

